/**
 * gpms
 * 2012-12-20 下午1:42:16
 * 作者：陈志明
 * 
 */
package com.gpms.privilege.service;

import java.util.List;

import com.gpms.common.service.BaseService;
import com.gpms.mapper.ItemDetails;
import com.gpms.privilege.dao.ItemDetailsDao;

/**
 * @author Jackie chen
 *
 */
public class ItemDetailsService extends BaseService {
	private ItemDetailsDao itemDetailsDao;
	
	/**
	 * 根据ID获取项目字典
	 * @param itemDetails
	 * @return
	 */
	public ItemDetails getItemDetailsById(ItemDetails itemDetails){
		return itemDetailsDao.findItemDetailsById(itemDetails);
	}
	
	/**
	 * 根据父项ID获取项目字典
	 * @param itemDetails
	 * @return
	 */
	public List<ItemDetails> getItemDetailsByParentId(String parentid){
		return itemDetailsDao.findItemDetailsByParentId(parentid);
	}
	
	/**
	 * 根据资源类别获取项目字典
	 * @param detailstype
	 * @return
	 */
	public List<ItemDetails> getItemDetailsByDetailsType(String detailstype){
		return itemDetailsDao.findItemDetailsByDetailsType(detailstype);
	}
	
	/**
	 * 添加一个项目字典
	 * @param itemDetails
	 * @return
	 */
	public int addItemDetails(ItemDetails itemDetails){
		return itemDetailsDao.saveItemDetails(itemDetails);
	}
	
	/**
	 * 根据ID修改项目字典
	 * @param itemDetails
	 * @return
	 */
	public int updateItemDetailsById(ItemDetails itemDetails){
		return itemDetailsDao.alterItemDetailsById(itemDetails);
	}
	
	/**
	 * 根据ID删除项目字典
	 * @param itemDetails
	 * @return
	 */
	public int deleteItemDetailsById(ItemDetails itemDetails){
		return itemDetailsDao.removeItemDetailsById(itemDetails);
	}

	
	
	/**
	 * @return the itemDetailsDao
	 */
	public ItemDetailsDao getItemDetailsDao() {
		return itemDetailsDao;
	}

	/**
	 * @param itemDetailsDao the itemDetailsDao to set
	 */
	public void setItemDetailsDao(ItemDetailsDao itemDetailsDao) {
		this.itemDetailsDao = itemDetailsDao;
	}
}
